/* Area Genitori - Gestione Mensa Scolastica */
/* Stili identici al backend admin ma ottimizzati per frontend */

body {
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
    background: white;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.gms-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Header principale - Sezione completamente separata */
.gms-main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 30px;
    text-align: center;
    position: relative;
    border-radius: 0 !important;
    margin-bottom: 0;
}

.gms-main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
}

.gms-header-content {
    position: relative;
    z-index: 1;
}

.gms-header-title {
    margin: 0;
    font-size: 2.8em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.gms-header-subtitle {
    opacity: 0.95;
    font-size: 1.3em;
    font-weight: 400;
    margin: 0;
}

/* Menu di navigazione - Sezione completamente separata */
.gms-main-nav {
    background: #ffffff;
    border-bottom: 3px solid #e9ecef;
    border-top: 1px solid #e9ecef;
    padding: 25px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.gms-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 20px;
    position: relative;
}

.gms-nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.gms-nav-link {
    color: #495057;
    padding: 15px 30px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 10px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    position: relative;
    min-width: 160px;
    text-align: center;
}

.gms-nav-link:hover {
    background: #e9ecef;
    color: #212529;
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    border-color: #dee2e6;
}

.gms-nav-link:active {
    transform: translateY(-1px);
}

/* Hamburger menu - Nascosto su desktop */
.gms-hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.gms-hamburger-menu span {
    width: 100%;
    height: 3px;
    background: #495057;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.gms-hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.gms-hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.gms-hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.gms-content {
    padding: 40px;
    background: white;
}

/* Assenze Section - Identica al backend */
.gms-assenze-section {
    background: white;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.gms-assenze-section-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gms-assenze-section-header h2,
.gms-assenze-section-header h3 {
    margin: 0;
    font-size: 1.4em;
    color: #495057;
    font-weight: 600;
}

.gms-assenze-section-content {
    padding: 30px;
}

/* Form Grid - Identico al backend */
.gms-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.gms-form-field {
    display: flex;
    flex-direction: column;
}

.gms-form-field label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gms-form-field input,
.gms-form-field textarea,
.gms-form-field select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    width: 100%;
}

.gms-form-field input:focus,
.gms-form-field textarea:focus,
.gms-form-field select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Buttons - Identici al backend */
.gms-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gms-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.gms-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.gms-btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Alert Messages - Identiche al backend */
.gms-alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.gms-alert.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.gms-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Login Form */
.gms-login-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.gms-form-group {
    margin-bottom: 25px;
}

.gms-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.gms-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.gms-form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Dashboard */
.gms-dashboard {
    display: grid;
    gap: 30px;
}

/* Sezione Saldo Genitore */
.gms-saldo-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.gms-saldo-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 0;
    transition: all 0.3s ease;
}

.gms-saldo-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.gms-saldo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.gms-saldo-header {
    position: relative;
    z-index: 2;
    margin-bottom: 15px;
    text-align: center;
}

.gms-saldo-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.gms-saldo-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.gms-saldo-amount {
    font-size: 2.4em;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
    letter-spacing: -0.5px;
    line-height: 1;
}

.gms-saldo-description {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.gms-genitore-info {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.gms-genitore-info h2 {
    margin: 0 0 15px 0;
    font-size: 1.8em;
    font-weight: 700;
}

.gms-genitore-info .gms-figlio-info {
    color: rgba(255, 255, 255, 0.95);
    margin-top: 10px;
    line-height: 1.6;
    font-weight: 500;
}

.gms-genitore-info h2 {
    color: white !important;
}

/* Figli Grid */
.gms-figli-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.gms-figlio-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.gms-figlio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.gms-figlio-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.gms-figlio-nome {
    font-size: 1.4em;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.gms-figlio-info {
    color: #6b7280;
    line-height: 1.6;
}

/* Pulsanti Figlio */
.gms-figlio-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.gms-figlio-actions .gms-btn {
    height: 55px;
    padding: 15px 20px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    min-height: 55px;
    box-sizing: border-box;
}

/* Nuovi stili per i pulsanti azione */
.gms-action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 55px !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.gms-action-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
    color: white !important;
    text-decoration: none !important;
}

.gms-action-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

.gms-btn-pasto-bianco {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #374151;
    border: 2px solid #e5e7eb;
    height: 55px;
    padding: 15px 20px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    min-height: 55px;
    box-sizing: border-box;
}

.gms-btn-pasto-bianco:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e5e7eb 100%);
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Assenze Lista */
.gms-assenze-lista {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.gms-assenza-item {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.gms-assenza-item:last-child {
    border-bottom: none;
}

.gms-assenza-item:hover {
    background: #f8fafc;
}

.gms-assenza-contenuto {
    flex: 1;
}

.gms-assenza-data {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
    font-size: 16px;
}

.gms-assenza-dettagli {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

.gms-assenza-motivo {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 5px;
    font-style: italic;
}

.gms-assenza-azioni {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.gms-btn-elimina {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gms-btn-elimina:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.gms-btn-elimina:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.gms-assenza-non-eliminabile {
    opacity: 0.6;
}

/* Header figlio selezionato */
.gms-figlio-selezionato-header {
    background: #f8f9fa;
    color: #2d3748;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

/* Back button */
.gms-back-btn {
    /* Rimuovo il posizionamento fixed per evitare sovrapposizioni */
    position: static;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gms-back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Toggle Data - Controlli radio per tipo data */
.gms-toggle-data {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gms-toggle-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.gms-toggle-option:hover {
    background: rgba(102, 126, 234, 0.1);
}

.gms-toggle-option input[type="radio"] {
    margin: 0;
    width: auto;
}

.gms-toggle-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

/* Filtro per mese - Stili migliorati */
.gms-filtro-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.gms-filtro-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin: 0;
    white-space: nowrap;
}

.gms-filtro-select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.gms-filtro-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.gms-filtro-select:hover {
    border-color: #667eea;
}

/* Responsive per il filtro */
@media (max-width: 768px) {
    .gms-content {
        padding: 20px;
    }
    
    .gms-figli-grid {
        grid-template-columns: 1fr;
    }
    
    .gms-form-grid {
        grid-template-columns: 1fr;
    }
    
    .gms-figlio-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .gms-action-btn {
        font-size: 14px !important;
        padding: 12px 16px !important;
        min-height: 50px !important;
    }
    
    .gms-figlio-selezionato-header {
        padding: 20px !important;
    }
    
    .gms-figlio-selezionato-header h1 {
        font-size: 1.8em !important;
    }
    
    /* Gestione responsive per header e menu */
    .gms-main-header {
        padding: 40px 20px;
    }
    
    .gms-header-title {
        font-size: 2.2em;
    }
    
    .gms-header-subtitle {
        font-size: 1.1em;
    }
    
    .gms-main-nav {
        padding: 20px 0;
        margin-bottom: 30px;
    }
    
    .gms-nav-container {
        justify-content: flex-end;
        padding: 0 20px;
        position: relative;
    }
    
    /* Hamburger menu - Mostrato su mobile */
    .gms-hamburger-menu {
        display: flex;
        position: absolute;
        top: 0;
        right: 0;
        z-index: 10;
    }
    
    /* Menu links - Nascosto di default su mobile */
    .gms-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: -20px;
        right: -20px;
        background: #ffffff;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        flex-direction: column;
        gap: 0;
        padding: 20px;
        margin-top: 10px;
        z-index: 100;
        width: calc(100% + 40px);
    }
    
    /* Menu links - Mostrato quando attivo */
    .gms-nav-links.active {
        display: flex;
    }
    
    .gms-nav-link {
        width: 100%;
        min-width: auto;
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 8px;
        margin: 5px 0;
        text-align: center;
    }
    
    .gms-back-btn {
        position: static;
        margin-bottom: 10px;
        display: inline-block;
    }
    
    .gms-toggle-data {
        flex-direction: column;
        gap: 10px;
    }

    .gms-filtro-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .gms-filtro-select {
        width: 100%;
        min-width: auto;
    }
}

/* Loading states */
.gms-loading {
    opacity: 0.6;
    pointer-events: none;
}

.gms-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
} 

/* Campi disabilitati - Stili per campi non modificabili */
.gms-form-field input:disabled,
.gms-form-field input[readonly] {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.gms-form-field input:disabled:focus,
.gms-form-field input[readonly]:focus {
    box-shadow: none !important;
    border-color: #dee2e6 !important;
}

/* Sezione Gestisci Conto */
.gms-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    margin-bottom: 30px;
}

.gms-card-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.gms-card-header h3 {
    margin: 0;
    font-size: 1.6em;
    font-weight: 700;
    color: #1f2937;
}

.gms-card-content {
    padding: 0;
}

.gms-figli-lista {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.gms-figlio-item {
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.gms-figlio-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.gms-radio-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.gms-radio-label input[type="radio"] {
    margin: 0;
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.gms-figlio-info {
    flex: 1;
}

.gms-figlio-nome {
    font-size: 1.2em;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.gms-figlio-dettagli {
    display: flex;
    gap: 20px;
    color: #6b7280;
    font-size: 0.95em;
}

.gms-figlio-crediti {
    font-weight: 600;
    color: #059669;
}

.gms-figlio-buoni {
    font-weight: 600;
    color: #dc2626;
}

.gms-form-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.gms-form-actions .gms-btn {
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
}

/* Responsive per Gestisci Conto */
@media (max-width: 768px) {
    .gms-card {
        padding: 20px;
    }
    
    .gms-figlio-dettagli {
        flex-direction: column;
        gap: 8px;
    }
    
    .gms-radio-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

.gms-form-help {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

/* Stili per validazione password */
.gms-password-requirements {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.gms-password-requirements h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.gms-password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gms-password-requirements li {
    padding: 8px 0;
    font-size: 14px;
    color: #6c757d;
    position: relative;
    padding-left: 25px;
}

.gms-password-requirements li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
}

.gms-password-requirements li.valid {
    color: #28a745;
}

.gms-password-requirements li.valid::before {
    content: "V";
}

.gms-password-strength {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
}

.gms-password-strength .weak {
    color: #dc3545;
}

.gms-password-strength .medium {
    color: #ffc107;
}

.gms-password-strength .strong {
    color: #28a745;
}

.gms-password-match {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
}

.gms-password-match .match {
    color: #28a745;
}

.gms-password-match .no-match {
    color: #dc3545;
} 